! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Clock applet doesn't sync to OS clock
Status:
RESOLVED: FIXED
Product:
Xfce4-panel

Comments

Description Max Grig 2007-02-27 10:51:37 CET
After OS clock changes (eg after timezone change or ntp sync) the clock applet still shows the old time.
Comment 1 Nick Schermer editbugs 2007-03-27 08:57:55 CEST
Not a panel plugin bug (and I'm sure it works here). We simple read the system time using time() and that's it.

If this happens with one (or more) layouts, please re-open. Also check if date shows the correct time after a time change.
Comment 2 huggie 2007-04-22 16:32:28 CEST
This bug does indeed exist.

The Orage clock plugin works fine, but the clock bundled with the panel does not.

If you change the system time the orage clock updates and the clock does not :)
The same happens if you change the timezone.

Try it.

I can't seem to change the status on this bug from RESOLVED INVALID to anything else right now - should I clone this to reopen it?
Comment 3 huggie 2007-04-22 16:33:14 CEST
Oh sorry, I confirmed this in 4.4.1
Comment 4 Jasper Huijsmans editbugs 2007-04-22 19:42:16 CEST
Thanks, it sounds like we should look at it more closely. Maybe we can copy what orage does.
Comment 5 Nick Schermer editbugs 2007-04-23 09:00:39 CEST
Orage uses strftime which is not usable for us (since the clock uses numbers, not strings). But I still don't see what the plugin is doing wrong: we ask the system time every second, convert it to the localtime and then draw the analog/digital or led clock...

Anyway, I'll take a look when I'm graduated (say in 8 weeks from now).
Comment 6 huggie 2007-06-18 10:10:21 CEST
Any news on this by the way?
Comment 7 Nick Schermer editbugs 2007-07-02 08:38:29 CEST
I've commited a fix in libxfcegui4 (xfce_4_4 branch), can you guys check it out?
Comment 8 Nick Schermer editbugs 2007-07-09 08:11:58 CEST
The patch in libxfcegui4/xfce_4_4 branch was reverted, but better code has been committed in xfce4-panel/trunk. If you don't display seconds, to clock update can take up to 1 minute.
Comment 9 Mark 2008-02-02 19:01:15 CET
This is probably the same issue, but if you change time zones, the clock applet doesn't update (even after a minute, and I'm displaying seconds).

Xfce4 4.4.1 (Xfce 4.4) - Ubuntu Gutsy
Comment 10 Leonid Evdokimov 2008-05-19 07:04:18 CEST
(In reply to comment #8)
> If you don't display seconds, to clock update can take up to 1 minute.

IMHO, that's not what `clock` is expected to show and clock should be updated at the first second, or, maybe at the second and not at the 48th one.
It's not too difficult to calculate right delay when next update should happen, it's something like 60-(time()%60).
Comment 11 Nick Schermer editbugs 2009-09-28 10:42:05 CEST
(In reply to comment #10)
> (In reply to comment #8)
> > If you don't display seconds, to clock update can take up to 1 minute.
> 
> IMHO, that's not what `clock` is expected to show and clock should be updated
> at the first second, or, maybe at the second and not at the 48th one.
> It's not too difficult to calculate right delay when next update should happen,
> it's something like 60-(time()%60).

It does sync to the first minute (or hour) and then start the timeout with the correct interval.

Anyway, been trying this again and whatever I do (change data with the date command, update with ntp or change timezone (export TZ="..."), the panel follows all the changes, for the latter you obviously need to restart the panel.

I will add some code that will sync the timeout once in a while (4.8 panel), but why the wrong date/time is shown on some systems I still don't know.
Comment 12 huggie 2009-09-28 12:48:40 CEST
What version did you test?

4.4.1 is quite old now ;)
Comment 13 Leonid Evdokimov 2009-09-28 12:59:45 CEST
(In reply to comment #11)
> It does sync to the first minute (or hour) and then start the timeout with the
> correct interval.

And then laptop goes to sleep-mode in the middle of the minute and timeout handler is called as soon as laptop is resumed, so resync is required.

I have panel 4.6.1 and I still see this issue.
Comment 14 Nick Schermer editbugs 2009-10-06 09:19:32 CEST
Should be fixed in master.

Bug #2957

Reported by:
Max Grig
Reported on: 2007-02-27
Last modified on: 2009-10-06

People

Assignee:
Nick Schermer
CC List:
2 users

Version

Version:
Unspecified

Attachments

Additional information